package common.util.mybatis.plus.logic;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
public class LogicBaseEntity implements Serializable{

	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@ApiModelProperty(value = "ID")
	@TableId(value = "id", type = IdType.AUTO )
	private Integer id;
	
	/**
	 *  版本
	 */
	@Version
	@ApiModelProperty(value = "版本")
	@TableField(value = "version" , fill = FieldFill.INSERT )
	private Integer version;
	
	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人")
	@TableField(value = "create_user" , fill = FieldFill.INSERT )
	private String createUser;
	
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	@TableField(value="create_time", fill = FieldFill.INSERT )
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	
	/**
	 * 修改人
	 */
	@ApiModelProperty(value = "修改人")
	@TableField(value ="modify_user", fill = FieldFill.INSERT_UPDATE )
	private String modifyUser;
	
	
	/**
	 * 修改时间
	 */
	@ApiModelProperty(value = "修改时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@TableField(value ="modify_time", fill = FieldFill.INSERT_UPDATE )
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date modifyTime;
	
	/**
	 * 删除[0:正常,1:删除]
	 */
	@TableLogic
	@ApiModelProperty(value = "删除[0:正常,1:删除]")
	@TableField(value ="removed" , fill = FieldFill.INSERT )
	private Integer removed;

}